<template>
  <div>
    <h_header></h_header>
    <h_right></h_right>
    <!-- 主体 -->
    <div>
      <!-- 开头介绍模块 -->
      <div class="first">
        <div class="NewsCenter">
          <h2>新闻中心</h2>
          <div class="inlineBlue"></div>
          <p>记录团队成长点滴以及对技术、理念的探索，同时我们乐于分享！</p>
        </div>
      </div>
      <!-- 下方nav和主体区域 -->
      <div class="newsMain">
        <!-- nav区域 -->
        <div class="newsNav">
          <a href="javascript:void(0);" class="navLeft" @click="exChange1"
            >公司新闻</a
          >
          <a href="javascript:void(0);" @click="exChange2">行业新闻</a>
        </div>
        <!-- 主体区域 -->
        <div class="knowMain">
          <div class="knowCard" v-for="item,index of knowList" :key="index">
            <img :src="item.knowImg" alt="" />
            <div class="textCard">
              <div class="title">
                <span>{{ item.title1 }}</span>
                <span
                  title="“初创公司”泰斯特：实行“共创模式”"
                  class="titleMain"
                >
                  <a href="javascript:void(0);" @click="Skip(index)">{{
                    item.title2
                  }}</a>
                </span>
              </div>
              <p class="tags">
                {{ item.p1 }}
                <i>查看</i>
                {{ item.p2 }}
              </p>
              <p class="textMain">
                {{ item.content }}
              </p>
            </div>
          </div>
        </div>
        <!-- 页码区域 -->
        <div class="page">
          <span>
            共
            <b>1</b>
            页
            <b>2</b>
            条记录
          </span>
        </div>
      </div>
    </div>
    <!-- 主体结束 -->
    <h_question></h_question>
    <h_footer></h_footer>
  </div>
</template>
<script>
import h_header from "@/components/header/header.vue";
import h_right from "@/components/right/right.vue";
import h_footer from "@/components/footer/footer.vue";
import h_question from "@/components/question/question.vue";
import { majorList } from '@/config/config.js'
export default {
  components: {
    h_header: h_header,
    h_right: h_right,
    h_footer: h_footer,
    h_question: h_question,
  },
  data() {
    return {
      knowList: [
        {
          knowImg: require("@/assets/news/company1.jpg"),
          title1: "公司新闻",
          title2: "“初创公司”泰斯特：实行“共创模式”",
          p1: "2019-10-25 ",
          p2: "(4178)",
          content:
            "“共创模式”即本公司作为软件服务提供商，与来自传统产业的企业或者初创公司共同组成共创团队，该团队致力于帮助企业创造价值,成为企业的专业软件技术团队，为企业带来低成本，高质...",
        },
        {
          knowImg: require("@/assets/news/company2.jpg"),
          title1: "公司新闻",
          title2: "泰斯特”三高“服务",
          p1: "2018-10-27 ",
          p2: "(3799)",
          content:
            "随着语音识别技术不断成熟，以及用户个性化词汇日益丰富，讯飞输入法的“个性化语音”更懂用户表达。近日，讯飞输入法发布Android V9.1.9455新版，重磅升级“语音智适应”功能...",
        },
      ],
      currentList:[],
      currentIndex: 0,
    };
  },
  methods: {
    exChange1() {
      this.$router.push({ path: "/CompanyNews" });
    },
    exChange2() {
      this.$router.push({ path: "/TradeNews" });
    },
    Skip(index) {
      console.log(index)
      this.$router.push({ path: "/NewList/" + index});
      this.currentList = majorList[index]
      this.currentIndex = index
      console.log(this.currentList)
      window.sessionStorage.setItem('currentList',JSON.stringify(this.currentList))
    },
  },
};
</script>

<style lang="scss">
.NewsCenter {
  background: url(../../assets/news/h-top-1.jpg) no-repeat;
}
</style>